home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks95 / MagicTitleHack.sit / MagicTitle / MagicTitle Source&Stuff / Source / FileSystemStuff.c next >
Text File  |  1995-06-22  |  747b  |  34 lines

  1. // FileSystemStuff.c
  2.  
  3. #include "FileSystemStuff.h"
  4. #include <Errors.h>
  5.  
  6. OSErr GetParent(const FSSpec *item, FSSpec *parent)
  7.     {
  8.     CInfoPBRec pb;
  9.     OSErr err = noErr;
  10.     
  11.     pb.hFileInfo.ioCompletion = 0;
  12.     pb.hFileInfo.ioNamePtr = parent->name;
  13.  
  14.     pb.hFileInfo.ioFDirIndex = -1;
  15.     pb.hFileInfo.ioVRefNum = item->vRefNum;
  16.     pb.hFileInfo.ioDirID = item->parID;
  17.     
  18.     err = PBGetCatInfoSync(&pb);
  19.     if(err == noErr)
  20.         err = FSMakeFSSpec (item->vRefNum,  pb.hFileInfo.ioFlParID, parent->name, parent);
  21.         
  22.     return err;
  23.     }
  24.     
  25.     
  26. OSErr MyFSMakeFSSpec(short volume, long directory, ConstStr255Param name, FSSpec *spec)
  27.     {
  28.     if(name[0] > 31)
  29.         return fnfErr;
  30.     spec->parID = directory;
  31.     spec->vRefNum = volume;
  32.     BlockMoveData(name, spec->name, name[0] + 1);
  33.     return noErr;
  34.     }